package Old;

/*
 * $Id: Item.java 12 2005-01-07 05:33:54Z rcleveng $
 */
import java.util.Date;

/* Da sistemare, per ora contiene campi "feed like", da trasformare nella versione universale
 * 
 */
public class Item 
{
  private String testo;

public Item()
  {
  }
  
  public String getGuid()
  {
    if ( _guid == null )
    {
      return getLink();
    }
    return _guid;
  }
  
  public void setGuid( String guid )
  {
    _guid = guid;
  }

 
  

  public String dumpString()
  {
    return "[Item] {PubDate: " + String.valueOf( _pubDate ) + "} {Title: " + _title + "} {Link: " + _link + "} {Description: " + _description + "}\n";
  }


  public String toString()
  {
    if ( _title == null || _title.length() == 0 )
    {
      if ( _description == null || _description.length() == 0 )
      {
        return "(none)";
      }
      return _description.substring( 0, 60 );
    }
    return _title;
  }





  public boolean equals( Object obj )
  {
    if ( obj instanceof Item )
    {
      Item other = ( Item ) obj;
      if ( _link != null && other._link != null )
      {
        return _link.equals( other._link );
      }
      else if ( _title != null && other._title != null )
      {
        return _title.equals( other._title );
      }
    }
    return false;
  }

}